package tech.aistar.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/6/2 3:19 下午
 */
@Data
public class User2 implements Serializable {
    private Long id;
    private String name;
    private Integer age;
    private String email;
    private Long managerId;
    //自动填充
    //插入时自动填充
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    //自动填充
    //插入时自动更新
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    //乐观锁- 支持的数据类型只有:int,Integer,long,Long,Date,Timestamp,LocalDateTime
    @Version
    private Integer version;
    //逻辑删除 - '逻辑删除标识,0-未删除,1-已删除'
    @TableField(select = false)
//    @TableLogic(delval = "1",value = "0")
    private Integer deleted;
}
